From dc282e386e9aa443896264544096867d515ca51c Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Thu, 28 Jul 2011 22:05:16 +0200 Subject: [PATCH] Remove gentoo files. --- conf/.gitignore => .gitignore | 0 Makefile | 34 +- conf/Xresources => Xresources | 0 conf/bash_completion => bash_completion | 0 conf/bashrc => bashrc | 0 conf/commonshrc => commonshrc | 0 conf/Makefile | 32 - conf/emacs.el => emacs.el | 0 gentoo/02locale | 1 - gentoo/Makefile | 25 - gentoo/grub.conf.m4 | 26 - gentoo/laptop-mode | 126 --- gentoo/local.conf.m4 | 34 - gentoo/m4conf-update | 9 - gentoo/machine-update | 1114 ------------------- gentoo/make-kernel | 31 - gentoo/regen-virtuals | 2 - gentoo/tla-mirror-all | 2 - conf/gnomerc => gnomerc | 0 conf/gnus.el => gnus.el | 0 conf/gpg.rc => gpg.rc | 0 conf/gvimrc => gvimrc | 0 conf/maildirs.m4 => maildirs.m4 | 0 conf/muttrc.m4 => muttrc.m4 | 0 conf/procmailrc.m4 => procmailrc.m4 | 0 conf/ratpoisonrc => ratpoisonrc | 0 conf/runcrm114 => runcrm114 | 0 conf/screenrc => screenrc | 0 {conf/ssh => ssh}/config | 0 conf/vimrc => vimrc | 0 conf/xsession => xsession | 0 {conf/zfuncs => zfuncs}/prompt_gebner_setup | 0 conf/zshrc => zshrc | 0 33 files changed, 30 insertions(+), 1406 deletions(-) rename conf/.gitignore => .gitignore (100%) rename conf/Xresources => Xresources (100%) rename conf/bash_completion => bash_completion (100%) rename conf/bashrc => bashrc (100%) rename conf/commonshrc => commonshrc (100%) delete mode 100644 conf/Makefile rename conf/emacs.el => emacs.el (100%) delete mode 100644 gentoo/02locale delete mode 100644 gentoo/Makefile delete mode 100644 gentoo/grub.conf.m4 delete mode 100644 gentoo/laptop-mode delete mode 100644 gentoo/local.conf.m4 delete mode 100644 gentoo/m4conf-update delete mode 100644 gentoo/machine-update delete mode 100644 gentoo/make-kernel delete mode 100644 gentoo/regen-virtuals delete mode 100644 gentoo/tla-mirror-all rename conf/gnomerc => gnomerc (100%) rename conf/gnus.el => gnus.el (100%) rename conf/gpg.rc => gpg.rc (100%) rename conf/gvimrc => gvimrc (100%) rename conf/maildirs.m4 => maildirs.m4 (100%) rename conf/muttrc.m4 => muttrc.m4 (100%) rename conf/procmailrc.m4 => procmailrc.m4 (100%) rename conf/ratpoisonrc => ratpoisonrc (100%) rename conf/runcrm114 => runcrm114 (100%) rename conf/screenrc => screenrc (100%) rename {conf/ssh => ssh}/config (100%) rename conf/vimrc => vimrc (100%) rename conf/xsession => xsession (100%) rename {conf/zfuncs => zfuncs}/prompt_gebner_setup (100%) rename conf/zshrc => zshrc (100%) diff --git a/conf/.gitignore b/.gitignore similarity index 100% rename from conf/.gitignore rename to .gitignore diff --git a/Makefile b/Makefile index d72b3af..55b7efd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,32 @@ -SUBDIRS = conf gentoo +FILES = ratpoisonrc vimrc Xresources zshrc $(wildcard zfuncs/*) emacs.el \ + bashrc bash_completion screenrc commonshrc gnomerc gvimrc -.PHONY: all install clean +ifeq "$(USER)" "gebner" +FILES += muttrc gnus.el ssh/config +XFILES = -all install clean: - @for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done +ifeq "$(shell hostname)" "marginata" +FILES += procmailrc +endif +endif + +.PHONY: all install clean check + +all: $(FILES) $(XFILES) + +install: $(FILES) $(XFILES) + mkdir -p ~/.zfuncs ~/.ssh + for i in $(FILES); do install -m0644 $$i ~/.$$i; done + for i in $(XFILES); do install -m0755 $$i ~/.$$i; done + +clean: + rm -f procmailrc muttrc + +check: $(FILES) $(XFILES) + for i in $(FILES) $(XFILES); do diff -u ~/.$$i $$i; done + +procmailrc muttrc: maildirs.m4 +muttrc: gpg.rc + +%: %.m4 + m4 $< >$@ diff --git a/conf/Xresources b/Xresources similarity index 100% rename from conf/Xresources rename to Xresources diff --git a/conf/bash_completion b/bash_completion similarity index 100% rename from conf/bash_completion rename to bash_completion diff --git a/conf/bashrc b/bashrc similarity index 100% rename from conf/bashrc rename to bashrc diff --git a/conf/commonshrc b/commonshrc similarity index 100% rename from conf/commonshrc rename to commonshrc diff --git a/conf/Makefile b/conf/Makefile deleted file mode 100644 index 55b7efd..0000000 --- a/conf/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -FILES = ratpoisonrc vimrc Xresources zshrc $(wildcard zfuncs/*) emacs.el \ - bashrc bash_completion screenrc commonshrc gnomerc gvimrc - -ifeq "$(USER)" "gebner" -FILES += muttrc gnus.el ssh/config -XFILES = - -ifeq "$(shell hostname)" "marginata" -FILES += procmailrc -endif -endif - -.PHONY: all install clean check - -all: $(FILES) $(XFILES) - -install: $(FILES) $(XFILES) - mkdir -p ~/.zfuncs ~/.ssh - for i in $(FILES); do install -m0644 $$i ~/.$$i; done - for i in $(XFILES); do install -m0755 $$i ~/.$$i; done - -clean: - rm -f procmailrc muttrc - -check: $(FILES) $(XFILES) - for i in $(FILES) $(XFILES); do diff -u ~/.$$i $$i; done - -procmailrc muttrc: maildirs.m4 -muttrc: gpg.rc - -%: %.m4 - m4 $< >$@ diff --git a/conf/emacs.el b/emacs.el similarity index 100% rename from conf/emacs.el rename to emacs.el diff --git a/gentoo/02locale b/gentoo/02locale deleted file mode 100644 index 12420e1..0000000 --- a/gentoo/02locale +++ /dev/null @@ -1 +0,0 @@ -LANG=de_AT.utf8 diff --git a/gentoo/Makefile b/gentoo/Makefile deleted file mode 100644 index ebbf186..0000000 --- a/gentoo/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -.PHONY: all install clean - -all install clean: - -PORTDIR = $(wildcard /usr/portage) - -ifeq "$(USER)" "root" -ifneq "$(PORTDIR)" "" - -BIN = machine-update tla-mirror-all -SBIN = laptop-mode m4conf-update make-kernel regen-virtuals -MISC = grub.conf.m4 local.conf.m4 02locale - -DIRS = /usr/local/bin /boot/grub /etc/fonts /etc/env.d - -install: - mkdir -p $(DIRS) - install -m755 -o0 -g0 $(BIN) $(SBIN) /usr/local/bin - install -m664 -o0 -g0 grub.conf.m4 /boot/grub - install -m664 -o0 -g0 local.conf.m4 /etc/fonts - install -m664 -o0 -g0 02locale /etc/env.d - m4conf-update - -endif -endif diff --git a/gentoo/grub.conf.m4 b/gentoo/grub.conf.m4 deleted file mode 100644 index ac19252..0000000 --- a/gentoo/grub.conf.m4 +++ /dev/null @@ -1,26 +0,0 @@ -default 0 -timeout 2 - -define(`host', `esyscmd(`hostname | xargs echo -n')') - -define(`main_part_grub', `(hd0,0)') -define(`kargs', `ifelse( - host, `schnecke2', `video=radeonfb:vesa:0x11B root=/dev/hda1', - host, `achatina', `video=radeonfb:vesa:0x11B udev dolvm2 root=/dev/ram0 init=/linuxrc real_root=/dev/datavg/gentoo', - host, `schnecke1', `video=matroxfb:vesa:0x11B root=/dev/hda1' -)') - -define(`kernel_file', `/boot/kernel-$1') - -define(`linux', ` -title Gentoo Linux $1 -root main_part_grub -kernel kernel_file(`$1') kargs -ifelse(host, `achatina', `initrd /boot/initramfs-genkernel-x86_64-$1') -') - -define(`m_linux', `linux($1) -ifelse(`$#', `1', `', `m_linux(shift($@))')') - -m_linux(esyscmd(`ls -t /boot/kernel-* | cut -c 14- | xargs echo -n \ - | tr " " ,')) diff --git a/gentoo/laptop-mode b/gentoo/laptop-mode deleted file mode 100644 index 686d193..0000000 --- a/gentoo/laptop-mode +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh - -# start or stop laptop_mode, best run by a power management daemon when -# ac gets connected/disconnected from a laptop -# -# install as /sbin/laptop_mode -# -# Contributors to this script: Kiko Piris -# Bart Samwel -# Dax Kelson -# Original Linux 2.4 version by: Jens Axboe - -parse_mount_opts () { - echo "$*" | \ - sed 's/commit=[0-9]*//g' | \ - sed 's/,,*/,/g' | \ - sed 's/^,//' | \ - sed 's/,$//' | \ - cat - -} - -KLEVEL="$(uname -r | cut -c1-3)" -case "$KLEVEL" in - "2.4") - true - ;; - "2.6") - true - ;; - *) - echo "Unhandled kernel level: $KLEVEL ('uname -r' = '$(uname -r)')" - exit 1 - ;; -esac - -# Shall we remount journaled fs. with appropiate commit interval? (1=yes) -DO_REMOUNTS=1 - -# age time, in seconds. should be put into a sysconfig file -MAX_AGE=600 - -# Allowed dirty ratio, in pct. should be put into a sysconfig file as well. -DIRTY_RATIO=40 - -# kernel default dirty buffer age -DEF_AGE=30 -DEF_UPDATE=5 -DEF_DIRTY_BACKGROUND_RATIO=10 -DEF_DIRTY_RATIO=40 - - -if [ ! -e /proc/sys/vm/laptop_mode ]; then - echo "Kernel is not patched with laptop_mode patch." - exit 1 -fi - -if [ ! -w /proc/sys/vm/laptop_mode ]; then - echo "You do not have enough privileges to enable laptop_mode." - exit 1 -fi - -case "$1" in - start) - AGE=$((100*$MAX_AGE)) - echo -n "Starting laptop_mode" - case "$KLEVEL" in - "2.4") - echo "1" > /proc/sys/vm/laptop_mode - echo "30 500 0 0 $AGE $AGE 60 20 0" > /proc/sys/vm/bdflush - ;; - "2.6") - echo "1" > /proc/sys/vm/laptop_mode - echo "$AGE" > /proc/sys/vm/dirty_writeback_centisecs - echo "$AGE" > /proc/sys/vm/dirty_expire_centisecs - echo "$DIRTY_RATIO" > /proc/sys/vm/dirty_ratio - echo "$DIRTY_RATIO" > /proc/sys/vm/dirty_background_ratio - ;; - esac - if [ $DO_REMOUNTS -eq 1 ]; then - cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do - PARSEDOPTS="$(parse_mount_opts "$OPTS")" - case "$FST" in - "ext3") mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE ;; - "reiserfs") mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE ;; - "xfs") mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE ;; - esac - done - fi - echo "." - ;; - stop) - U_AGE=$((100*$DEF_UPDATE)) - B_AGE=$((100*$DEF_AGE)) - echo -n "Stopping laptop_mode" - case "$KLEVEL" in - "2.4") - echo "0" > /proc/sys/vm/laptop_mode - echo "30 500 0 0 $U_AGE $B_AGE 60 20 0" > /proc/sys/vm/bdflush - ;; - "2.6") - echo "0" > /proc/sys/vm/laptop_mode - echo "$U_AGE" > /proc/sys/vm/dirty_writeback_centisecs - echo "$B_AGE" > /proc/sys/vm/dirty_expire_centisecs - echo "$DEF_DIRTY_RATIO" > /proc/sys/vm/dirty_ratio - echo "$DEF_DIRTY_BACKGROUND_RATIO" > /proc/sys/vm/dirty_background_ratio - ;; - esac - if [ $DO_REMOUNTS -eq 1 ]; then - cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do - PARSEDOPTS="$(parse_mount_opts "$OPTS")" - case "$FST" in - "ext3") mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;; - "reiserfs") mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;; - "xfs") mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;; - esac - done - fi - echo "." - ;; - *) - echo "$0 {start|stop}" - ;; - -esac - -exit 0 diff --git a/gentoo/local.conf.m4 b/gentoo/local.conf.m4 deleted file mode 100644 index 750085a..0000000 --- a/gentoo/local.conf.m4 +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - /usr/share/fonts/corefonts - - ifelse(esyscmd(`hostname | xargs echo -n'), `schnecke2', - ` - - rgb - ') - - define(`font_repl', ` - - $1 - - - $2 - - ') - - dnl Replace bit-mapped fonts with AA fonts - font_repl(`Helvetica', `Arial') - font_repl(`Times', `Times New Roman') - font_repl(`Courier', `Courier New') - - dnl Now replace M$ fonts with Bitstream ones... - font_repl(`Arial', `Bitstream Vera Sans') - font_repl(`Times New Roman', `Bitstream Vera Serif') - font_repl(`Courier New', `Bitstream Vera Mono Sans') - font_repl(`Verdana', `Bitstream Vera Sans') - font_repl(`Andale Sans UI', `Bitstream Vera Sans') - diff --git a/gentoo/m4conf-update b/gentoo/m4conf-update deleted file mode 100644 index b8b111e..0000000 --- a/gentoo/m4conf-update +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -. /etc/init.d/functions.sh - -einfo "Regenerating M4 config files" -for i in /etc/fonts/local.conf /boot/grub/grub.conf; do - ebegin " $i" - m4 "$i.m4" >"$i" - eend $? -done diff --git a/gentoo/machine-update b/gentoo/machine-update deleted file mode 100644 index 563a3b8..0000000 --- a/gentoo/machine-update +++ /dev/null @@ -1,1114 +0,0 @@ -#!/usr/bin/perl -w -# For Emacs: -*- mode:cperl; mode:folding; -*- -# -# Get a machine's critical features, And mail/http them to the Linux Counter -# -# (c) 1999 - Harald Tveit Alvestrand, the Linux Counter Project -# 2003 - PetaMem Group (www.petamem.com) -# License: GNU Copyleft - see bottom of file. -# Changelog: see even more bottom of the file -# -# As a matter of courtesy, if you change this file on your own, -# make sure it does NOT mail to the counter! -# -use strict; -use POSIX; - -our $VERSION = '0.20'; -our $CVS_VERSION = '$Revision: 1.25 $ $Date: 2003/12/28 23:59:48 $ $Author: hta $'; -our $IsInTestHarness; -use vars qw(%values %oldvalues $errordata $debugdata); # data that is sent -use vars qw($progname %option); -use vars qw(%is_sys_account %is_user %is_account); - -# Some variables are for internal use, and never prompted for in -# the loop of askquestions -our %dontask = ('uniqueid' => 1, # Internal use - 'manual' => 1, - 'method' => 1, - 'owner' => 1, # These 2 are always prompted for - 'key' => 1, - 'uptime' => 1, # We think we know how to get these - ); - -# stuff that controls defaults for passwdscan & accounts subroutines -my ($UID_MIN, $UID_MAX, $got_defs) = (100, 65533, ''); - -# Make sure nothing happens, so that the script's routines -# can be debugged from another file -return 1 if($IsInTestHarness); - -&preparation; -&options; - -&readfile; -&checkconfig; - -if ($option{ask}) { - &askquestions; -} else { - ©manuals; -} - -&writefile; -&sendfile; - -# {{{ preparation - -# -sub preparation { - die "No HOME environment variable\n" if (!$ENV{HOME}); - die "No home diretory\n" if ! -d $ENV{HOME}; - my $infodir = "$ENV{HOME}/.linuxcounter"; - if (! -d $infodir) { - mkdir($infodir, 0766) || die "Unable to make $infodir\n"; - } - # Keep track of where I am; need it to install crontab entry - # progname is a global. - $progname = $0; - if ($progname !~ /^\//) { - my $progdir = `pwd`; - chop $progdir; - $progname = "$progdir/$progname"; - $progname =~ s!/./!/!; - } - chdir($infodir) || die "Unable to change to $infodir\n"; - my ($sysname, $nodename, $release, $version, $machine ) = POSIX::uname(); - if (! -f $nodename) { - print STDERR "Machine-update $VERSION. Use $0 -l to display license.\n"; - print STDERR "Creating the infofile for your computer.\n"; - # Create the infodir - open(INFO, ">$nodename"); - print INFO "uniqueid: ", randomnumber(), "\n"; - close INFO; - } - - srand time % $$; # do some seed "randomization" -} - -# }}} -# {{{ options - -# -sub options { - my $opt; - - while (defined($ARGV[0]) && $ARGV[0] =~ /^-/) { - $opt = shift @ARGV; - $opt =~ /c/ && &installcrontab; - $opt =~ /d/ && $option{DEBUG}++ && print STDERR "Debug is $option{DEBUG}\n"; - $opt =~ /h/ && &help; - $opt =~ /i/ && ($option{ask} = 1); - $opt =~ /l/ && &license; - $opt =~ /m/ && ($option{mail} = 1); - $opt =~ /t/ && ($option{mail} = 0); - $opt =~ /u/ && &uninstallcrontab; - $opt =~ /v/ && die "\n\t Linux Counter machine-update version $VERSION\n" - . "\tCVS version $CVS_VERSION\n"; - $opt =~ /x/ && ($option{info} = 1); - } -} - -# }}} - -# {{{ askquestions - -# -sub askquestions { - return if ! -t STDIN || ! -t STDOUT; - $| = 1; - print "Here you can specify some info that the script can't know for itself\n"; - $values{owner} = askone("Your Linux Counter reg#, if any", $values{owner}); - $values{key} = askone("Your machine's counter reg#, if any", $values{key}); - print "Here is what the program has found:\n"; - for my $key (keys(%values)) { - if (!$dontask{$key}) { - printf "%-10s%1s: %s\n", $key, $dontask{$key}?"*":" ", $values{$key}; - } - } - my $domore = &askone('Do you want to override some of the found values?', 'no'); - if ($domore =~ /^Y/i) { - my $manual; - for my $key (keys(%values)) { - next if $dontask{$key}; - my $value = &askone($key, $oldvalues{$key}, $values{$key}); - if ($values{$key} eq $value) { # go to automatic - &Debug("auto value: $key\n"); - } else { - &Debug("still manual value: $key\n"); - $manual .= " $key"; - } - $values{$key} = $value; - } - $values{manual} = $manual; - } else { - delete $values{manual}; - } -} - -# }}} -# {{{ askone -# -sub askone { - my $prompt = shift; - my $default = shift; - my $probed = shift; - - print $prompt; - if (!defined($default) && defined($probed)) { - $default = $probed; - } - if (defined($default)) { - print " [$default]"; - } - if (defined($probed) && $probed ne $default) { - print "(program found $probed)"; - } - print ':'; - - my $ans = ; - - chop $ans; - &Debug("Answer was $ans\n"); - $ans = $default if (!length($ans)); - - return $ans; -} -# }}} - -# {{{ copymanuals -# -sub copymanuals { - my %keeps = map {$_ => 1} split(' ', $values{manual}); - - &Debug('Keeping '.join(' ', keys(%keeps))."\n"); - for my $key (keys(%keeps)) { - $values{$key} = $oldvalues{$key}; - } -} -# }}} - -# {{{ readfile - -# -sub readfile { - my ($sysname, $nodename, $release, $version, $machine ) = POSIX::uname(); - open(INFO, $nodename) || die "Did not find infofile $nodename\n"; - while () { - chop; - s/#.*//; - if (/^(\S+): *(.+)/) { - &Debug("Read $1: $2\n"); - $values{$1} = $2; - } else { - print STDERR "Unparsed info line: $_ - discarded\n"; - } - } - close INFO; - %oldvalues = %values; -} - -# }}} -# {{{ writefile - -# -sub writefile { - my ($sysname, $nodename, $release, $version, $machine ) = POSIX::uname(); - - open(INFO, ">$nodename.new"); - for my $val (sort keys(%values)) { - &Debug("Saving $val: $values{$val}\n"); - print INFO "$val: $values{$val}\n"; - } - close INFO; - rename("$nodename.new", $nodename) || die "Rename failed\n"; -} - -# }}} -# {{{ sendfile - -# -sub sendfile { - if ($option{mail}) { - open(MAIL, "|/usr/lib/sendmail machine-registration\@counter.li.org") - || die "Unable to open sendmail\n"; - } else { - warn "--------------------------------------------------------\n"; - warn "This is what will be sent to the Linux Counter if you\n"; - warn "run the program with the -m switch. Now, NOTHING IS SENT\n"; - warn "--------------------------------------------------------\n"; - open(MAIL, ">&STDOUT"); - } - # note that $ENV{USER} isn't (always) set in a cron job... - my $user = (getpwuid($<))[0]; - $user = "unknown-id-$<" if !$user; - print MAIL < 0; - } - print MAIL "//END\n"; - # Attach possible other info - if ($errordata) { - print MAIL "----- Problem info gathered during probing -----\n"; - print MAIL $errordata; - } - $option{info} && do { - print MAIL "----- Debug data for the script maintainer's aid -----\n"; - print MAIL $debugdata; - }; - close MAIL; -} - -# }}} - -# {{{ randomnumber -# -sub randomnumber { - return int(rand(1_000_000_000)); -} -# }}} - -# {{{ checkconfig - -# -sub checkconfig { - my ($sysname, $nodename, $release, $version, $machine ) = POSIX::uname(); - - warn "This is not Linux, but $sysname!\n" if($sysname ne 'Linux'); - $values{method} = "machine-update version $VERSION"; - $values{os} = $sysname; - $values{kernel} = $release; - $values{cpu_uname} = $machine; - $values{name} = $nodename; # First order guess - - # Credit for some of the code below goes to - # Denis Havlik: - # Blame is, of course, all mine - HTA - - # Note - there are numerous problems with df, including: - # - early versions don't support the -l option - # - at least some include SAMBA filesystems in the -l option - open (TMP,"df -l -x shm |"); # exclude shmfs, its 50% of RAM (mostly) - my $HD = 0; - while () { - my @line = split(/\s+/); - ($line[0] =~ /\/dev/) && ($HD += $line[1]); - } - &Debug("$HD kbytes of disk found\n"); - $HD /= 1024; - $values{disk} = sprintf("%d", $HD); - $values{accounts} = &accounts; - $values{users} = &active_users; - - my $uptime = &xbin('uptime'); - if($uptime) { - $uptime = `$uptime`; - # get the uptime string here (could be more elegant, but so it is - # robust against various localizations) - if ($uptime =~ /^\s+[^\s]+\s+[^\s]+\s+([^,]+), /) { - $values{uptime} = $1; - } else { - &ErrorInfo("Can't parse uptime output: $uptime\n"); - } - if ($option{info}) { - &DebugInfo("***** Uptime output *****\n$uptime"); - } - } - # Not sure this is a Right Thing...so not saving it for the moment - # This section based on a patch from Mark-Jason Dominus - # try to guess mailer based on content of /usr/lib/sendmail link - if (-l '/usr/lib/sendmail') { - my $realsendmail = readlink('/usr/lib/sendmail'); - if ($realsendmail eq '../sbin/sendmail') { - $realsendmail = '/usr/sbin/sendmail'; - if (-l $realsendmail) { - $realsendmail = readlink($realsendmail); - } - } - if ($realsendmail =~ m{^/var/qmail}) { - $values{mailer} = "qmail"; - } else { - &DebugInfo("Found sendmail as a link to $realsendmail\n"); - } - } - # Link method did not work. Try to guess based on presence of - # config files. (this is more susceptible to the old-junk problem) - if (!$values{mailer}) { - if ( -d '/var/qmail') { - $values{mailer} = 'qmail'; - } elsif ( -f '/etc/sendmail.cf') { - $values{mailer} = 'sendmail'; - } elsif ( -d '/etc/postfix') { - $values{mailer} = 'postfix'; - } - } - - # forget about /proc/kcore: It's not reliable above 960MB. It also doesn't show - # real memory, because some may be eaten by graphics - # forget also about the "free" command: We don't want to be dependant on that - $values{memory} = int(&getval_from_file('/proc/meminfo',1,1) / (1024*1024)); - # But actually: Shouldn't we return the total of virtual memory here? Seems to - # be relevant to me - RJ - - - &cpuinfo; -} - -# }}} - -# {{{ cpuinfo - -# -sub cpuinfo { - my $cpufile = '/proc/cpuinfo'; # Linux: Place to get info on CPU - my %interesting = (# 2.0 and 2.2 kernels - 'bogomips' => '+bogomips', - 'processor' => '1+processors', - 'vendor_id' => 'cpu_vendor', - # 2.0 kernels - 'cpu' => 'cpu_only', - 'model' => 'cpu_model', - 'model name' => 'cpu_model_name', - # 2.2 kernels - 'cpu MHz' => 'cpu_mhz', - 'cpu family' => 'cpu_family', - # from an Alpha processor - 'cycle frequency [Hz]' => 'cpu_hz', - 'BogoMIPS' => '+bogomips', - 'cpu model' => 'cpu_model', - 'system type' => 'cpu_system_type', - 'cpus detected' => 'processors', - # from a PowerMAC - 'machine' => 'cpu_machine', - 'clock' => 'cpu_clock', - 'motherboard' => 'cpu_motherboard', - # from an UltraSparc - 'BogoMips' => '+bogomips', - 'ncpus active' => 'processors', - ); - - # Zero out the accumulative values - $values{bogomips} = 0; - $values{processors} = 0; - if (open (TMP,"<$cpufile")) { - &DebugInfo("**** Contents of $cpufile ****\n"); - while () { - &DebugInfo($_); # Save /proc/cpuinfo to debugdata if -d - chop; - # A bizarre selection of names are "interesting". - # Make a data-driven pick routine - if (/^(\S+[^:]+\S)\s+: /) { - my $name = $1; - my $value = $'; - if ($interesting{$name}) { - if ($interesting{$name} =~ /^\+/) { - $values{$'} += $value; - } elsif ($interesting{$name} =~ /^1\+/) { - $values{$'}++; - } else { - $values{$interesting{$name}} = $value; - } - } - } - } - } else { - &ErrorInfo("Could not open $cpufile\n"); - } -} - -# }}} - -# {{{ accounts - -# -sub accounts { - my $s; - my $niss; - my $ypcatbin; # will hold path to the ypcat binary (if any) - - open (TMP," /dev/null|" - || ($errordata .= "ypcat failed: $!\n"); - $niss = &passwdscan; - $s += $niss; - close TMP; - &Debug("Status of ypcat: $?\n"); - &DebugErr("Found $niss accounts in ypcat passwd\n"); - } - - &DebugErr('Sysaccounts: ', join(' ', keys(%is_sys_account)), "\n"); - &DebugErr("Found $s accounts total\n"); - - return $s; -} - -# }}} -# {{{ passwdscan - -# -sub passwdscan { - # Code for reading login.defs courtesy of Vassilii Khachaturov - # - local (*DEFS); - # Try importing UID_MIN and UID_MAX from /etc/login.defs, if possible - # else just assume the above defaults for min and max non-system UID - if (!$got_defs && open (DEFS, '/etc/login.defs')) { - while () { - if (/^\s*(UID_(?:MIN|MAX))\s+(\d+)/) { - # elegant, but not compatible with "strict refs": - #${ $1 } = $2; - if ($1 eq "UID_MIN") { - $UID_MIN = $2; - } else { - $UID_MAX = $2; - } - &Debug("DEFS match: $1 = $2\n"); - } - } - close (DEFS); - $got_defs = 1; - } - &Debug("UID_MIN = $UID_MIN, UID_MAX = $UID_MAX\n"); - # I suppose this is as good as it gets - - # Usually user accounts have UID > 100 and - # "system accounts" have UID < 100, but there is no guarantee - # that - # this will hold for pseudo-users like "postgress" etc. - # Also nobody is usually 99 on linux, but -1 on "standard" unices. - # RedHat places the dividing line at 500. Others use 400... - my @line; - my $s = 0; - - while () { - @line = split ':'; - if ($line[2] >= $UID_MIN && $line[2] <= $UID_MAX - && !($line[0] eq 'nobody')) { - $s++; - $is_account{$line[0]} = 1; - } else { - $is_sys_account{$line[0]} = 1; - } - } - - return $s; -} - -# }}} -# {{{ active_users - -# -# This is kind of alpha, but please test it. -# It calculates the number of "active" users based on the "wtmp" entries -# unfortunately at least Mandrake 8 and 9 ship with non-world-read wtmp -# and non-set-uid last, so this does not work any more... -# -# RJ: Actually I think the best thing to do is to bury this code and be silent about it. -# -sub active_users { - my $userslisted; - - for (qw(reboot wtmp runlevel)) { # This sysaccounts shouldn't be counted. Who else? - $is_sys_account{$_} = 1; - } - open( TMP, "/usr/bin/last 2>&1|"); - while () { - chop; - if (m!/var/log/wtmp: Permission denied!) { # RJ: ***Boom*** on every non-EN system - &ErrorInfo("/usr/bin/last failed because /var/log/wtmp isn't readable\n"); - last; - } - last if(!$_); # RJ: quick hack to safe bad code from harm - my @tmp = split; - my $name = $tmp[0]; - if ($is_sys_account{$name}) { - # do nothing - } elsif (defined $is_account{$name}) { - $is_user{$name} = 1; - } elsif (/^\s*$/) { # blank line - do nothing - } elsif ($#tmp == 9) { # OK line, but unknown user - $option{DEBUG} && do { - if (!$userslisted) { - print STDERR 'Know users are: ', - join(' ', keys(%is_account)), "\n"; - $userslisted = 1; - } - print STDERR "Unknown user: $name\n"; - } - } else { - &DebugErr("Strange line: $_\n"); - } - } - close TMP; - my $i = 0; - for (sort keys %is_user) { - $option{DEBUG} && printf "Active user %3d: %s\n", ++$i, $_; - } - &Debug("$i active users found.\n"); - - return $i; -} - -# }}} - -# {{{ installcrontab - -# -sub installcrontab { - my $hour = int(rand(24)); - my $min = int(rand(60)); - my $day = int(rand(7)); # Weekday. This version runs once a week. - my $cron; - - warn "Installing start of script into your crontab\n"; - if (open(CRON, "crontab -l |")) { - &Debug("Checking crontab for machine-update\n"); - &Debug("Want to install as $progname\n"); - while () { - if (/^#/ && $. <= 3) { # initial comment - &Debug("Skipping comment: $_"); - next; - } - if (/machine-update/) { - if (/ $progname -m/) { - die "Crontab entry already installed: $_\n"; - } else { - die "Another entry with machine-update: $_\n"; - } - } - $cron .= $_; - } - close CRON; - &Debug("Result from crontab -l: ", $? / 256, "\n"); - if ($? == 0) { - &Debug("Crontab successfully read\n"); - } elsif ($? == 256) { - warn "You don't seem to have a crontab. I will create one.\n"; - } else { - die "Failed to read your crontab. Please report this as a bug: $?\n"; - } - } else { - &Debug("Result from crontab open(): $?\n"); - die "Unable to execute crontab command. Please check your system\n"; - } - open(CRON, "|crontab -"); - print CRON $cron; - print CRON "$min $hour * * $day $progname -m\n"; - close CRON; - &Debug("Result from crontab: $?\n"); - if ($?) { - die(<) { - if (/^#/ && $. <= 3) { # initial comment - &Debug("Skipping comment: $_"); - next; - } - if (/machine-update/) { - if (/ $progname -m/) { - print STDERR "Crontab entry found and removed\n"; - $found = 1; - next; # skip stuff at end.... - } else { - die "Another entry with machine-update: $_\nUninstall manually?\n"; - } - } - $cron .= $_; - } - close CRON; - &Debug("Result from crontab -l: $?\n"); - if ($?) { - die "Failed to read your crontab. You may not have one?\n"; - } - if ($found) { - open(CRON, "|crontab -"); - print CRON $cron; - close CRON; - &Debug("Result from crontab: $?\n"); - if ($?) { - die(<; # read whole file to array - close FH; - - @cols = split /\s+/, $file[$row]; # get the right row - - return $cols[$col]; # return the right column -} - -# }}} - -# {{{ Debug print debug information if flag is set - -# -sub Debug { - $option{DEBUG} && print @_; -} - -# }}} -# {{{ DebugErr print debug on STDERR if flag is set - -# -sub DebugErr { - $option{DEBUG} && print STDERR @_; -} - -# }}} -# {{{ ErrorInfo -sub ErrorInfo { - $errordata .= join('', @_); -} -# }}} -# {{{ DebugInfo - -sub DebugInfo { - $option{info} && ($debugdata .= join('', @_)); -} - -# }}} - -# {{{ help print help & exit - -# -sub help { - my $host = `uname -n`; - - print <960MB capable -# - slightly better randomness -# -#vim:ts=8:sw=4:sts=4 - diff --git a/gentoo/make-kernel b/gentoo/make-kernel deleted file mode 100644 index 99f8ac2..0000000 --- a/gentoo/make-kernel +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -. /etc/init.d/functions.sh - -if [ -z "$1" ]; then - KV=`ketchup -m 2>/dev/null` - - if [ -z "$KV" ]; then - KV=`readlink $PWD` - KV=`basename "$KV"` - test -z "$KV" && KV=`basename $PWD` - KV=${KV:6} - if [ -z "$KV" ]; then - eerror "Could not resolve kernel version" - exit 1 - fi - fi -else - KV=$1 -fi - -einfo "I am now going to build kernel $KV" -einfo "Press C-c to stop or RET to continue..." -read - -set -ex - -make -j4 -make modules_install -cp arch/*/boot/bzImage /boot/kernel-$KV -cp .config /boot/config-$KV -m4conf-update diff --git a/gentoo/regen-virtuals b/gentoo/regen-virtuals deleted file mode 100644 index 782f91c..0000000 --- a/gentoo/regen-virtuals +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -find /var/db/pkg/ -name PROVIDE | perl -ne 'chomp;($p)=m#^/var/db/pkg/(.*?/.*?)-(\d+.*)/PROVIDE$#; {local$/=undef;open$f,$_;$c=<$f>;close$f}$c=~s/^\s*//;$c=~s/\s*$//;@c=split/\s+/,$c;($v{$_}.=" $p")for@c; END{while(($k,$v)=each%v){print"$k$v\n"}}' >/var/cache/edb/virtuals diff --git a/gentoo/tla-mirror-all b/gentoo/tla-mirror-all deleted file mode 100644 index 0741718..0000000 --- a/gentoo/tla-mirror-all +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -tla archives | grep MIRROR | sed s/-MIRROR// | xargs -n1 tla archive-mirror diff --git a/conf/gnomerc b/gnomerc similarity index 100% rename from conf/gnomerc rename to gnomerc diff --git a/conf/gnus.el b/gnus.el similarity index 100% rename from conf/gnus.el rename to gnus.el diff --git a/conf/gpg.rc b/gpg.rc similarity index 100% rename from conf/gpg.rc rename to gpg.rc diff --git a/conf/gvimrc b/gvimrc similarity index 100% rename from conf/gvimrc rename to gvimrc diff --git a/conf/maildirs.m4 b/maildirs.m4 similarity index 100% rename from conf/maildirs.m4 rename to maildirs.m4 diff --git a/conf/muttrc.m4 b/muttrc.m4 similarity index 100% rename from conf/muttrc.m4 rename to muttrc.m4 diff --git a/conf/procmailrc.m4 b/procmailrc.m4 similarity index 100% rename from conf/procmailrc.m4 rename to procmailrc.m4 diff --git a/conf/ratpoisonrc b/ratpoisonrc similarity index 100% rename from conf/ratpoisonrc rename to ratpoisonrc diff --git a/conf/runcrm114 b/runcrm114 similarity index 100% rename from conf/runcrm114 rename to runcrm114 diff --git a/conf/screenrc b/screenrc similarity index 100% rename from conf/screenrc rename to screenrc diff --git a/conf/ssh/config b/ssh/config similarity index 100% rename from conf/ssh/config rename to ssh/config diff --git a/conf/vimrc b/vimrc similarity index 100% rename from conf/vimrc rename to vimrc diff --git a/conf/xsession b/xsession similarity index 100% rename from conf/xsession rename to xsession diff --git a/conf/zfuncs/prompt_gebner_setup b/zfuncs/prompt_gebner_setup similarity index 100% rename from conf/zfuncs/prompt_gebner_setup rename to zfuncs/prompt_gebner_setup diff --git a/conf/zshrc b/zshrc similarity index 100% rename from conf/zshrc rename to zshrc