Remove some very outdated / ununused scripts

This commit is contained in:
Nico Schottelius 2018-03-30 14:27:22 +02:00
parent 585f9cd271
commit 406bd43f4a
15 changed files with 0 additions and 409 deletions

View File

@ -1,3 +0,0 @@
/root/scripts/add-links "$1"
/root/scripts/rekursivperms "$1"
chown -R .util "$1"

View File

@ -1,80 +0,0 @@
BASEDIR=/home/server/www/org/wddb/www/
tmp=/tmp/wddb-$$
function report()
{
# sender
UFLINE
# return path
RPLINE
# we
RECIPIENT
# delivered to..
DTLINE
# set
}
function init()
{
cat > $tmp
}
# continent
continent=`grep "^continent" "$1" | sed 's/.*="\(.*\)"/\1/'`
case "$continent" in
africa|asia|australia|europe|northamerica|southamerica) ;;
*) report "Allowed continents: africa|asia|australia|europe|northamerica|southamerica" ;;
esac
# other vars
essid=`grep "^essid" "$1" | sed 's/.*="\(.*\)"/\1/'`
# remove possible dots
country=`grep "^country" "$1" | sed 's/.*="\(.*\)"/\1/' | sed 's/\.\.//g'`
area=`grep "^area" "$1" | sed 's/.*="\(.*\)"/\1/' | sed 's/\//-/g' | sed 's/ //c'`
mac=`grep "^mac" "$1" | sed 's/.*="\(.*\)"/\1/'`
rate=`grep "^rate" "$1" | sed 's/.*="\(.*\)"/\1/'`
wep=`grep "^wep" "$1" | sed 's/.*="\(.*\)"/\1/'`
hints=`grep "^hints" "$1" | sed 's/.*="\(.*\)"/\1/'`
location=`grep "^location" "$1" | sed 's/.*="\(.*\)"/\1/'`
# check for empty fields
for a in essid country area mac rate wep hints location; do
eval tmp="\$$a"
if [ -z "$tmp" ]; then
report "Empty field: $a"
fi
done
if [ ! -f $BASEDIR/$continent/$country/$area.html ]; then
cat << EOF > "$1"
<html>
<head>
<title>wddb.org - WarDriver's DataBase</title>
</head>
<BODY bgcolor="#000000" color="#ef0000" font-color="#ef0000">
<FONT COLOR="#ef0000">
else
lines=`cat "$BASEDIR/$continent/$country/$area.html" | wc |awk '{ print $1 }'`
use_lines=$[$lines-7]
head -n $use_lines "$BASEDIR/$continent/$country/$area.html" > "$1"
fi
cat << EOF >> "$1"
</TABLE>
<HR>
<A HREF="../index.html"> << One step back</A>
<P><A HREF="/submit-new.html">Submit new network or changes<A>
</FONT>
</BODY>
</HTML>
EOF

View File

@ -1,3 +0,0 @@
modprobe usb-storage
modprobe ohci-hcd
modprobe sd_mod

153
attach
View File

@ -1,153 +0,0 @@
#!/usr/bin/perl -wT
#
# TWiki Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 1999-2003 Peter Thoeny, peter@thoeny.com
#
# For licensing info read license.txt file in the TWiki root.
# 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, published at
# http://www.gnu.org/copyleft/gpl.html
# Set library paths in @INC, at compile time
BEGIN { unshift @INC, '.'; require 'setlib.cfg'; }
use CGI::Carp qw( fatalsToBrowser );
use CGI;
use TWiki;
use strict;
#open(STDERR,'>&STDOUT'); # redirect error to browser
$| = 1; # no buffering
&main();
# =========================
sub listVersions
{
my( $web, $topic, $attachment ) = @_;
my $latestRev = TWiki::Store::getRevisionNumber( $web, $topic, $attachment );
$latestRev =~ /\.(.*)/;
my $maxRevNum = $1;
my $found = 0;
my $result = "\n| *Version:* | *Action:* | *Date:* | *Who:* | *Comment:* |\n";
for( my $version = $maxRevNum; $version >= 1; $version-- ) {
my $rev = "1.$version";
my( $date, $userName, $dummy, $comment ) =
TWiki::Store::getRevisionInfo( $web, $topic, $rev, "TWiki date", $attachment );
my $wikiUserName = &TWiki::userToWikiName( $userName );
my $viewAction = "<a href=\"%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/%WEB%/%TOPIC%?rev=$rev&filename=$attachment\">view</a>";
$result .= "| 1.$version | $viewAction | $date | $wikiUserName | $comment |\n";
}
$result = "$result";
return $result;
}
# =========================
sub main
{
my $query = new CGI;
my $thePathInfo = $query->path_info();
my $theRemoteUser = $query->remote_user();
my $theTopic = $query->param( 'topic' );
my $theUrl = $query->url;
my( $topic, $webName, $dummy, $userName ) =
&TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic, $theUrl, $query );
$dummy = ""; # to suppress warning
my $tmpl = "";
my $text = "";
my $meta = "";
my $atext = "";
my $fileName = "";
my $fileUser = "";
my $wikiUserName = &TWiki::userToWikiName( $userName );
my $isHideChecked = "";
if( ! &TWiki::Store::webExists( $webName ) ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsnoweb" );
TWiki::redirect( $query, $url );
return;
}
my( $mirrorSiteName, $mirrorViewURL ) = &TWiki::readOnlyMirrorWeb( $webName );
if( $mirrorSiteName ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsmirror", $mirrorSiteName, $mirrorViewURL );
TWiki::redirect( $query, $url );
return;
}
# check access permission
if( ! &TWiki::Access::checkAccessPermission( "change", $wikiUserName, "", $topic, $webName ) ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsaccesschange" );
TWiki::redirect( $query, $url );
return;
}
$fileName = $query->param( 'filename' ) || "";
if( &TWiki::Store::topicExists( $webName, $topic ) ) {
( $meta, $text ) = &TWiki::Store::readTopic( $webName, $topic );
}
my %args = $meta->findOne( "FILEATTACHMENT", $fileName );
%args = ( "attr" => "", "path" => "", "comment" => "" ) if( ! % args );
if ( $args{"attr"} =~ /h/o ) {
$isHideChecked = "checked";
}
if ( $fileName ) {
$atext = listVersions( $webName, $topic, $fileName );
}
# why log attach before post is called?
# FIXME: Move down, log only if successful (or with error msg?)
# Attach is a read function, only has potential for a change
if( $TWiki::doLogTopicAttach ) {
# write log entry
&TWiki::Store::writeLog( "attach", "$webName.$topic", $fileName );
}
my $fileWikiUser = "";
my $skin = $query->param( "skin" ) || TWiki::Prefs::getPreferencesValue( "SKIN" );
if( $fileName && %args ) {
$tmpl = TWiki::Store::readTemplate( "attachagain", $skin );
$fileWikiUser = &TWiki::userToWikiName( $args{"user"} );
} else {
$tmpl = TWiki::Store::readTemplate( "attachnew", $skin );
}
$tmpl =~ s/%ATTACHTABLE%/$atext/go;
$tmpl =~ s/%FILEUSER%/$fileWikiUser/go;
$tmpl = &TWiki::handleCommonTags( $tmpl, $topic );
$tmpl = &TWiki::getRenderedVersion( $tmpl );
$tmpl = &TWiki::handleMetaTags( $webName, $topic, $tmpl, $meta );
$tmpl =~ s/%HIDEFILE%/$isHideChecked/go;
$tmpl =~ s/%FILENAME%/$fileName/go;
$tmpl =~ s/%FILEPATH%/$args{"path"}/go;
$tmpl =~ s/%FILECOMMENT%/$args{"comment"}/go;
TWiki::writeHeader( $query );
print $tmpl;
}
# EOF

View File

@ -1,10 +0,0 @@
HOST=eiche
DESTDIR=/mnt/datennirvana/backup/bruehe
EXCLUDE_FILE=/root/.backup-exclude
#time rsync -e ssh -av --exclude-from=/root/.backup-exclude / 192.168.23.33:/mnt/backup/bruehe
time rsync -e ssh -av --exclude-from=$EXCLUDE_FILE / "$HOST":"$DESTDIR"
#echo "Shutting down $HOST..."
#ssh $HOST "shutdown -h now"

View File

@ -1,18 +0,0 @@
NEWROOT=/mnt/eiche
DATA_DIRS="bin boot etc home lib opt root sbin tmp usr var"
SCRIPTS="/root/scripts/to_eiche"
# display how long we backup
date
for script in $SCRIPTS; do
$script
done
# create empty dirs
mkdir -p $NEWROOT/dev $NEWROOT/proc $NEWROOT/mnt
for a in /mnt/*; do mkdir -p $NEWROOT/$a; done
cd /
tar cf - $DATA_DIRS | ( cd $NEWROOT; tar xf - )
date

View File

@ -1,4 +0,0 @@
#!/bin/sh
mkdir ~/p/
mr checkout

View File

@ -1,3 +0,0 @@
#!/bin/sh
cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/max_brightness | sudo tee /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness

View File

@ -1,30 +0,0 @@
dev1="/dev/sd$1"; shift
dev2="/dev/sd$1"; shift
dev3="/dev/sd$1"; shift
#devs='/dev/sde /dev/sdf /dev/sdg'
devs="/dev/sde /dev/sdc /dev/sdd"
set -e
set -x
mdadm --assemble /dev/md0 $dev1 $dev2 $dev3
cryptsetup luksOpen /dev/md0 raid
fsck /dev/mapper/raid
mount /home/services/raid
exit 0
#mdadm --assemble /dev/md0 /dev/sde /dev/sdf /dev/sdg
#cryptsetup luksOpen /dev/md0 raid
[19:25] denkbrett:~nico# mdadm --assemble --scan
/dev/md0: File exists
mdadm: /dev/md/0 has been started with 2 drives (out of 3).
mdadm: /dev/md/0 already active, cannot restart it!
mdadm: /dev/md/0 needed for /dev/sdc...
mdadm: /dev/md/0 already active, cannot restart it!
mdadm: /dev/md/0 needed for /dev/sdc...
[19:25] denkbrett:~nico# mdadm --manage -a /dev/md0 /dev/sdc
mdadm: re-added /dev/sdc
[19:25] denkbrett:~nico#

View File

@ -1,2 +0,0 @@
cryptsetup luksClose raid
mdadm --misc --stop /dev/md0

View File

@ -1,13 +0,0 @@
#!/bin/sh
#
# Nico Schottelius <nico-linux@schottelius.org>
# Date: 17-Sep-2005
# Last Modified: -
#
[ $# -eq 1 ] || exit 23
PACKAGE=$1; shift
PREFIX=/usr/packages/$PACKAGE
./configure --prefix=$PREfIX $@ && make

View File

@ -1,38 +0,0 @@
#!/bin/sh
if [ $# -lt 1 ]; then
echo "$0 disk [fullsize]"
exit 1
fi
set -x
export DEV=$1; shift
export ID=$(ceph osd create)
ceph-disk zap $DEV
ceph-disk prepare --bluestore $DEV --osd-id ${ID} --osd-uuid $(uuidgen) --crush-device-class hdd
mkdir /var/lib/ceph/osd/ceph-${ID}
mount ${DEV}1 /var/lib/ceph/osd/ceph-${ID}
touch /var/lib/ceph/osd/ceph-${ID}/sysvinit
ceph auth get-or-create osd.${ID} osd 'allow *' mon 'allow profile osd' > /var/lib/ceph/osd/ceph-${ID}/keyring
echo ${ID} > /var/lib/ceph/osd/ceph-${ID}/whoami
ceph-osd --cluster ceph -i ${ID} --mkfs
chown -R ceph:ceph /var/lib/ceph/osd/ceph-${ID}
SIZE_REAL=$(fdisk -l | grep ${DEV}2 | cut -d " " -f7 | sed 's/T//')
# Start with small data to get a feeling if disk really works
SIZE_FAKE=0.1
if [ $# -ge 1 ]; then
SIZE=$SIZE_REAL
else
SIZE=$SIZE_FAKE
fi
ceph osd crush add osd.${ID} ${SIZE} host=$(hostname)
/etc/init.d/ceph start osd.${ID}

View File

@ -1,9 +0,0 @@
#!/bin/sh
OLD='\[ Nico at Schottelius dot org \]'
NEM='\[ info: use finger @schottelius.org ]'
if [ ! -d "$1" ]; then
cat "$1" | sed "s/$OLD/$NEW/g"
#> $1.tmp
#mv $1.tmp $1
fi

View File

@ -1,29 +0,0 @@
check_file()
{
if [ ! -h "$1" ]; then
echo "$1" is not a link\! Please FIXME\!
if [ ! -e "$1" ]; then
echo "$1" is broken. removing.
#rm "$1"
fi
fi
}
for a in /usr/bin/* ; do
check_file "$a"
done
for a in /usr/lib/* ; do
check_file "$a"
done
for a in /usr/sbin/*; do
check_file "$a"
done
for a in /usr/include/*; do
check_file "$a"
done

View File

@ -1,14 +0,0 @@
#!/bin/sh
# cLinux
# Nico Schottelius (nico-linux@schottelius.org)
# 2005-03-27
# build a standard package
[ $# -ne 1 ] && exit 1
PRE_PREFIX=/usr/packages
PKGDL=$1
PREFIX=${PRE_PREFIX}/${PKGDL}
./configure "--prefix=${PREFIX}"